package com.study.spring;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestXmlBeanFactory {

    public static void main(String[] args) {
        AbstractApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
        HelloWorld helloWorld = context.getBean(HelloWorld.class);
        helloWorld.say();
        // HelloWorld helloWorld1 = context.getBean(HelloWorld.class);
        // helloWorld.say();
        // System.out.println(helloWorld.hashCode());
        // System.out.println(helloWorld1.hashCode());
        context.destroy();
//        factory.destroySingleton("helloWorld");
    }
}
